package Ventanas;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.border.EmptyBorder;

public class VentanaUsuario extends JFrame implements ActionListener {
	
	private JButton boton1;
	private JButton boton2;
	private JButton boton3;
	
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					VentanaUsuario frame = new VentanaUsuario();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	public VentanaUsuario() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		//setBounds(100, 100, 1200, 900);
		this.setExtendedState(JFrame.MAXIMIZED_BOTH);
		
		Fondo p = new Fondo();
		p.setBorder(new EmptyBorder(5, 5, 5, 5));
		p.setLayout(new BorderLayout(0, 0));
		setContentPane(p);
		
		setLayout(null);
		
		boton1=new JButton("Jugador Nuevo");
		boton1.setBounds(450,350,150,30);
		add(boton1);
		boton1.addActionListener(this);
	   
		boton2=new JButton("Jugador Existente");
		boton2.setBounds(450,400,150,30);
		add(boton2);
		boton2.addActionListener(this);
	   
		boton3=new JButton("Volver");
		boton3.setBounds(450,450,150,30);
		add(boton3);
		boton3.addActionListener(this);
			
	}
	
    public void actionPerformed(ActionEvent e) {
        
    	if (e.getSource()==boton1){
    		VentanaCreacionUsuario frame = new VentanaCreacionUsuario();
    		frame.setVisible(true);
    	} else {
    		if (e.getSource()==boton2){
				VentanaContinuarPartida frame = new VentanaContinuarPartida();
				frame.setVisible(true);
    	} else {
    		if (e.getSource()==boton3) {
				VentanaPrincipal frame = new VentanaPrincipal();
				frame.setVisible(true);
    		}

    		}
    	}
    }
}